<%-- 
    Document   : list
    Created on : May 14, 2011, 11:33:46 AM
    Author     : gerardino
--%>
<%@include file="/Common/header.jsp" %>
<script type="text/javascript" src="/scripts/Products/list.js"></script>
<%
    Inventory i = (Inventory)request.getAttribute("i");
%>
<h2>Listado de Productos</h2>
<table class="grid">
    <tr>
        <th class="longtext">Producto</th>
        <th class="text">Medida</th>
        <th class="number">Saldo</th>
    </tr>
<%    
    if (i.getProduct().isEmpty()){
%>
    <tr>
        <th colspan="3">No hay productos en este inventario.</th>
    </tr>    
<%        
    } else {
        for(Product p : i.getProduct()){
%>
    <tr>
        <td><%= p.getName() %></td>
        <td><%= p.getMeasure() %></td>
        <td><%= p.getRemaining() %></td>
    </tr>
<%            
        }
    }
%>
    <tr><th colspan="3">&nbsp;</th></tr>
</table>
    
    <p>
        <span class="ui-icon ui-icon-circle-plus" style="float:left; margin:0 7px 50px 0;"></span>
        <a href="#" onClick="newProduct('<%= i.getId().getId() %>')">Nuevo producto</a>
    </p>